const App = {
    mixins: [Query],//配置文件，路径/utils/mixins.js
    data() {
        return {
            input: "", //输入框
            treeData: [], //树的数据
            originalTreeData: [], //原始树的数据
            originalTableData: [], // 原始表格的数据
            columns: [], //表格的列
            loading: false, //表数据的懒加载
            showDialog: false, //设置字段弹窗
            checkedFields: [], //选中的字段
            isDataReady: false,
            Tabletdata: [], //表格的数据
            fields: [], //字段列表
            value: "",
            Total: 0,
            page:{
                value1:'',
                value2:'',
                PageNumber: 1, //页码
                RowAmount: 10,
                Condition: window.btoa(unescape(encodeURIComponent("%%"))),
                ExtensionCondition:'',
            },
            
        };
    },
    mounted() {

    },
    computed: {
        // 计算属性，返回选中的字段
        isAllChecked() {
            return this.checkedFields.length === this.fields.length;
        },
    },
    methods: {
        xinwenjilu(row){
            window.location.href = './news.html?nodeKey=' + row.Policy_SerialNumber
        },
        changeValue2(val){
            if (val == null) {
                console.log('空指针处理');
                this.page.value2 = '';
            }
        },
        //查询按钮
        check() {
            let value1 = this.page.value1, value2 = this.page.value2?this.page.value2:'';
            this.page.Condition =  window.btoa(unescape(encodeURIComponent("%"+value1+"%")));
            if (value2) {
                this.page.ExtensionCondition =  window.btoa(unescape(encodeURIComponent("AND DATE_FORMAT(subsidy_policy.`Effective_Date`, '%Y')="+value2+"")));
            } else {
                this.page.ExtensionCondition =  '';
            }
            this.postgetList(this.page);
        },
        xinwen(row){
            window.location.href = "../../news_videos_files/news/add.html?action=Add&Policy_SerialNumber=" + row.Policy_SerialNumber;
        },
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus,{locale: zhCn});
app.mount("#app");
